package com.sex.bull.melancholy.service.mybatis.service;

import com.sex.bull.melancholy.service.mybatis.bean.DictCustomerProperty;
import com.sex.bull.melancholy.service.mybatis.dao.DictCustomerPropertyDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by LiM on 2017/8/7.
 * 客户属性字典
 */
@Service
public class DictCustomerPropertyService {
    @Autowired
    private DictCustomerPropertyDao dictCustomerPropertyDao;

    /**
     * 查询数据
     * @param dictCustomerProperty
     * @return
     * @throws Exception
     */
    public List<DictCustomerProperty> queryAllList(DictCustomerProperty dictCustomerProperty) throws Exception{
        return dictCustomerPropertyDao.queryAllList(dictCustomerProperty);
    }

    /**
     * 单条数据新增
     * @param dictCustomerProperty
     */
    public void addData(DictCustomerProperty dictCustomerProperty) throws Exception{
        dictCustomerPropertyDao.addData(dictCustomerProperty);
    }

    /**
     * 批量新增数据
     * @param objs
     */
    public void addData(List<DictCustomerProperty> objs) throws Exception {
        dictCustomerPropertyDao.addData(objs);
    }

    /**
     * 更新单条数据
     * @param dictCustomerProperty
     */
    public void updateData(DictCustomerProperty dictCustomerProperty) throws Exception{
        dictCustomerPropertyDao.updateData(dictCustomerProperty);
    }

    /**
     * 逻辑删除数据
     * @param dictCustomerProperty
     * @throws Exception
     */
    public void deleteData(DictCustomerProperty dictCustomerProperty) throws Exception{
        dictCustomerPropertyDao.deleteData(dictCustomerProperty);
    }

    /**
     * 根据英文名称查找
     * @param list
     * @return
     * @throws Exception
     */
    public List<DictCustomerProperty> getEnHas(List<String> list) throws Exception{
        return dictCustomerPropertyDao.getEnHas(list);
    }

    /**
     * 批量逻辑删除数据
     * @param list
     * @throws Exception
     */
    public void  deleteDataBat(List<String> list) throws Exception{
        dictCustomerPropertyDao.deleteData(list);
    }
}
